import request from './request'

// 案件状态选项
export const CASE_STATUS_OPTIONS = [
  { value: 0, label: '进行中', type: 'warning' },
  { value: 1, label: '已结案', type: 'success' },
  { value: 2, label: '上诉', type: 'danger' }
]

// 案件状态映射
export const CASE_STATUS = {
  0: '进行中',
  1: '已结案',
  2: '上诉'
}

// 案件分页查询
export const getCasePage = (params) => {
  return request.get('/case/page', { params })
}

// 案件详情查询
export const getCaseDetail = (id) => {
  return request.get(`/case/${id}`)
}

// 案件新增
export const createCase = (data) => {
  return request.post('/case', data)
}

// 案件更新
export const updateCase = (data) => {
  return request.put('/case', data)
}

// 案件删除
export const deleteCase = (id) => {
  return request.delete(`/case/${id}`)
}
